{% extends "bootstrap/base.html" %}
{% block title %}首页{% endblock %}
{% block styles %}
    {{ super() }}
    <style>
        body {
            background-image: url("{{ url_for('static',filename='images/bg.jpg') }}");
        }

        #myfoot {
            border-top: 1px solid darkgray;
            font-size: 14px;
            text-align: center;
            color: lightgray;
        }

        .navbar {
            height: 70px;
            padding-top: 10px;
        }

        #bs-example-navbar-collapse-1 {
            font-size: 18px;
            font-weight: bold;
        }

        .navbar-brand {
            font-size: 25px;
            font-weight: bold;
        }

    </style>
{% endblock %}

{% block navbar %}
    <div style="height: 80px;"></div>
    <nav class="navbar navbar-inverse">
        <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <a class="navbar-brand" href="{{ url_for('user.index_self') }}">个人博客</a>

            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li ><a href="{{ url_for('user.index') }}">首页 <span
                            class="sr-only">(current)</span></a></li>

                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                           aria-expanded="false">文章分类 <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            {% for type in types %}
                                {% if not loop.last %}
                                    <li>
                                        <a href="{{ url_for('article.type_search') }}?tid={{ type.id }}">{{ type.type_name }}</a>
                                    </li>
                                    <li role="separator" class="divider"></li>
                                {% else %}
                                    <li><a href="{{ url_for('article.type_search') }}?tid={{ type.id }}">{{ type.type_name }}</a></li>
                                {% endif %}
                            {% endfor %}
                        </ul>
                    </li>
                    <li><a href="{{ url_for('user.show_board') }}">留言板</a></li>
                    <li><a href="{{ url_for('user.myphoto') }}">我的相册</a></li>

                </ul>
                <form class="navbar-form navbar-left" action="{{ url_for('user.index') }}">
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="Search" name="search">
                    </div>
                    <button type="submit" class="btn btn-default">搜索</button>
                </form>

                <ul class="nav navbar-nav navbar-right">
                    {% if user %}
                        <li><img src="{% if user.icon %}{{ url_for('static',filename=user.icon) }}
                                      {% else %}{{ url_for('static',filename='images/touxiang.jpg') }}{% endif %}"
                                      alt="" style="border-radius: 15px;margin-top: 8px;width: 30px; height: 30px;"></li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                               aria-haspopup="true" aria-expanded="false">欢迎！{{ user.username }}<span
                                    class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li><a href="{{ url_for('user.user_center') }}">用户中心</a></li>
                                <li role="separator" class="divider"></li>
                                <li><a href="{{ url_for('user.logout') }}">退出</a></li>
                            </ul>
                        </li>
                    {% else %}
                        <li><a href="{{ url_for('user.login') }}">登录</a></li>
                        <li><a href="{{ url_for('user.register') }}">注册</a></li>
                    {% endif %}
                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
{% endblock %}

{% block content %}
    {% block newcontent %}
        <h1>Hello, Bootstrap</h1>
    {% endblock %}
    {% block footer %}
        <p id="myfoot">京ICP备11008000号-6京公网安备11010802020853</p>
    {% endblock %}
{% endblock %}



